#include "stdafx.h"
#include "GameResource.h"


CGameResource::CGameResource()
{
}


CGameResource::~CGameResource()
{
}

void CGameResource::LoadMonsterImg()
{
	for (int i = 0; i < MONSTER_KIND_COUNT; i++)
	{
		m_MonsterImg[i][0][0] = cvLoadImage("..\\Data\\image\\red01.png");
		m_MonsterImg[i][0][1] = cvLoadImage("..\\Data\\image\\red02.png");
		m_MonsterImg[i][1][0] = cvLoadImage("..\\Data\\image\\red_boss01.png");
		m_MonsterImg[i][1][1] = cvLoadImage("..\\Data\\image\\red_boss02.png");

		m_MonsterImg[i][0][2] = cvCreateImage(CvSize(m_MonsterImg[i][0][0]->width, m_MonsterImg[i][0][0]->height),
			m_MonsterImg[i][0][0]->depth, m_MonsterImg[i][0][0]->nChannels);
		m_MonsterImg[i][0][3] = cvCreateImage(CvSize(m_MonsterImg[i][0][1]->width, m_MonsterImg[i][0][1]->height),
			m_MonsterImg[i][0][1]->depth, m_MonsterImg[i][0][1]->nChannels);

		m_MonsterImg[i][1][2] = cvCreateImage(CvSize(m_MonsterImg[i][1][0]->width, m_MonsterImg[i][1][0]->height),
			m_MonsterImg[i][1][0]->depth, m_MonsterImg[i][1][0]->nChannels);
		m_MonsterImg[i][1][3] = cvCreateImage(CvSize(m_MonsterImg[i][1][1]->width, m_MonsterImg[i][1][1]->height),
			m_MonsterImg[i][1][1]->depth, m_MonsterImg[i][1][1]->nChannels);

		cvFlip(m_MonsterImg[i][0][0], m_MonsterImg[i][0][2], 1);
		cvFlip(m_MonsterImg[i][0][1], m_MonsterImg[i][0][3], 1);
		cvFlip(m_MonsterImg[i][1][0], m_MonsterImg[i][1][2], 1);
		cvFlip(m_MonsterImg[i][1][1], m_MonsterImg[i][1][3], 1);
	}
}

void CGameResource::LoadTowerImg()
{
}

void CGameResource::LoadBulletImg()
{
}

void CGameResource::Init()
{
	LoadMonsterImg();
	LoadTowerImg();
	LoadBulletImg();
}

void CGameResource::Release()
{
}

IplImage ** CGameResource::GetFace(int kind,int boss)
{
	return m_MonsterImg[kind][boss];
}
